<?php

/**
 * Klasa z formatkami dot. u�ytkownika
 *
 */
class Default_Form_Gps {
	
	public function generate() {
		$form = new Core_Form();
		
		$dateFormat = Zend_Locale::getTranslation(null, 'date', Zend_Locale::ZFDEFAULT);

		$form->setName('generateForm')
			->setMethod(Core_Form::METHOD_POST)
			->setAction(Zend_Controller_Front::getInstance()->getRouter()->assemble(array()))

			->addElements(array(
				$form->createElement('text', 'from')
					->setLabel('Data rozpoczęcia podróży')
					->setRequired(true)
					->setAttrib('maxlength', strlen($dateFormat))
					->setValue($dateFormat)
					->addValidator('StringLength', true, array(strlen($dateFormat)))
					->addValidator('Date', true, array($dateFormat)),

				$form->createElement('text', 'to')
					->setLabel('Data zakończenia podróży')
					->setRequired(true)
					->setAttrib('maxlength', strlen($dateFormat))
					->setValue($dateFormat)
					->addValidator('StringLength', true, array(strlen($dateFormat)))
					->addValidator('Date', true, array($dateFormat)),

				$form->createElement('submit', 'generate')
					->setLabel('Generuj')
			));
		return $form;
	}
}
?>